Don't pass NULL to g_variant_new_string
authorMatthias Clasen <mclasen@redhat.com>
Sat, 10 Oct 2020 14:06:50 +0000 (10:06 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 12 Oct 2020 19:10:40 +0000 (15:10 -0400)
That does not work.

gtk/a11y/gtkatspiroot.c

index a3b3a4f9fb25e0c355940fe4c2865fa0906cc3ea..9d93de27f9223b262ce1e023178b75c5ec3fd1cc 100644 (file)
@@ -346,9 +346,9 @@ handle_accessible_get_property (GDBusConnection       *connection,
   GVariant *res = NULL;
 
   if (g_strcmp0 (property_name, "Name") == 0)
-    res = g_variant_new_string (g_get_prgname ());
+    res = g_variant_new_string (g_get_prgname () ? g_get_prgname () : "Unnamed");
   else if (g_strcmp0 (property_name, "Description") == 0)
-    res = g_variant_new_string (g_get_application_name ());
+    res = g_variant_new_string (g_get_application_name () ? g_get_application_name () : "No description");
   else if (g_strcmp0 (property_name, "Locale") == 0)
     res = g_variant_new_string (setlocale (LC_MESSAGES, NULL));
   else if (g_strcmp0 (property_name, "AccessibleId") == 0)